package com.xxq.semester.service.impl.classmgmt;

import com.xxq.semester.entity.classmgmt.ClassStudents;
import com.xxq.semester.mapper.ClassStudentsMapper;
import com.xxq.semester.service.classmgmt.IClassStudentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author saki
 * @since 2025-07-13
 */
@Service
@RequiredArgsConstructor
public class ClassStudentsServiceImpl extends ServiceImpl<ClassStudentsMapper, ClassStudents> implements IClassStudentsService {
    @Autowired
    private ClassStudentsMapper classStudentsMapper;
    @Override
    public Boolean addClassStudents(ClassStudents classStudents) {
        return save(classStudents);
    }
    @Override
    public Boolean deleteClassStudents(Integer classId,Integer studentId) {
        return classStudentsMapper.deleteClassStudents(classId, studentId);
    }
    @Override
    public List<ClassStudents> getClassStudentsByClassId(Integer classId) {
        return classStudentsMapper.getClassStudentsByClassId(classId);
    }
    @Override
    public Boolean getInClassByInviteCode(Integer classId,Integer studentId) {
        return classStudentsMapper.getInClassByInviteCode(classId, studentId);
    }
}
